package com.tl.sun.ui.adapter;

import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.tl.sun.R;
import com.tl.sun.model.ModelCity;

import java.util.List;

/**
 * 作者：HQY on 17/8/21 18:15
 * 邮箱：hqy_xz@126.com
 */

public class ModelCityAdapter extends BaseQuickAdapter<ModelCity, BaseViewHolder> {


    public ModelCityAdapter(List<ModelCity> data) {
        super(R.layout.item_model_city, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ModelCity item) {
        TextView mTvCity = helper.getView(R.id.tv_city_name);
        mTvCity.setText(item.getCity());
        if (item.isShow()) {
            mTvCity.setBackgroundColor(mContext.getResources().getColor(R.color.package_name));
            mTvCity.setTextColor(mContext.getResources().getColor(R.color.color_white));
        } else {
            mTvCity.setBackgroundColor(mContext.getResources().getColor(R.color.color_white));
            mTvCity.setTextColor(mContext.getResources().getColor(R.color.color_222222));
        }
    }
}
